-
Notifications
You must be signed in to change notification settings - Fork 149
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: incessant requerying of nfts with missing metadata #5747
Conversation
1fbc7c1
to
4b54db2
Compare
@@ -18,7 +16,13 @@ interface StacksCryptoAssetsProps { | |||
export function StacksCryptoAssets({ address }: StacksCryptoAssetsProps) { | |||
const names = useGetBnsNamesOwnedByAddressQuery(address).data?.names; | |||
|
|||
const stacksNftsMetadataResp = useStacksNonFungibleTokensMetadata(address); | |||
// NftMetadataResponse[] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be removed I believe?
@alter-eggo to implement similar solution for FTs to compare with this PR |
@alter-eggo do you think this is OK to merge and get released? Once we remove this code |
@pete-watters I think we can close this pr |
We can merge it? Or just close it as the work is no longer needed? |
@pete-watters just closed, problem is resolved here leather-io/mono#377 |
This PR adds some state to prevent requerying of metadata when we know that it isn't, and won't, be there in future. This'll save loads of requests to Hiro's APIs.
This PR only tackles NFTs. Perhaps you can follow up doing the same with FTs @alter-eggo?
Adding this highlights some of the failures of the query package, I think. For example, the "query hook" in question was actually a wrapper hook, preventing accessing the internals. A rule for query package should be that ONLY options creator functions are returned. I think we shouldn't even return wrapped
useQueries
as it get confusing when we need to create an app-specific clone of same name.Before
2024-08-09-000266.mp4
After
Now only has FT missing queries
2024-08-09-000267.mp4